Due to scaling challenges, recent memory technologies may transition from using charge-based memories, such as dynamic random access memory (DRAM), to resistive and magneto-resistive memories, such as phase-change memory (PCM). However, many such memories tend to wear out.
Memory may wear when a system writes to the memory because a write may change the physical configuration of the material in the memory or degrade it in some other manner. Memories vulnerable to this issue are referred to as wearable memories. Due to the gradual degradation, wearable memories are subject to memory failures that can prevent the memory from reliably storing data for the system after a large amount of writes by the system. For example, a PCM cell can typically sustain 108 writes before wearing out (i.e., failing), while a DRAM cell can typically sustain 1015 writes before failing.
Memory for a system may be divided into a plurality of regions, each region having multiple segments. A system may use the memory regions as a unit for memory allocation (e.g., during runtime) and/or transferring of data between a main memory and an auxiliary store, such as a hard disk drive. As individual segments in a memory region begin to fail due to a large number of writes, memory fragmentation occurs. Memory fragmentation arises when a memory region is divided into smaller portions of usable memory (e.g., one or more contiguous “working” segments) that are separated by a failed, or worn out, segment that is non-usable. Although the small portions of usable memory between the failed segments are still reliable for memory allocation, they are effectively unusable to a system because the small portions are individually too small to store larger objects (e.g., data) whose storage requires contiguous memory (e.g., multiple contiguous segments). In other words, the system cannot fit larger objects between two failed memory segments due to fragmentation.